<?php

namespace app\index\controller;

use app\common\controller\Frontend;
use fast\BaiduTransapi;

use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
use PhpOffice\PhpSpreadsheet\Reader\Xlsx;
use PhpOffice\PhpSpreadsheet\Reader\Xls;
use PhpOffice\PhpSpreadsheet\Reader\Csv;

class Index extends Frontend
{

    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = '';

    public function index()
    {
//        echo "asdf";exit;

        include_once ROOT_PATH.'public/index.html';
    }

    public function test(){
        $model = model('Article');
        $data = $model->where(['id'=>62])->find();

        print_r($data->image_items);
        exit;
//        /uploads/yuepu/20241024/c761bd812e3d3b40d4619ca88127f544.jpg,/uploads/yuepu/20241024/b28c0860ace02a49d7c1cc3c4c92b509.jpg,
//        /uploads/yuepu/20241024/8ac0a528d1c3e04412cd0a526b3f19b0.jpg,/uploads/yuepu/20241024/9733f336a14124cbc26b40618f21f0ff.jpg
        $imagePath = 'https://img.kanpuba.com/uploads/yuepu/20241024/b28c0860ace02a49d7c1cc3c4c92b509.jpg';
        $imageSize = getimagesize($imagePath);
        print_r($imageSize);
        $width = $imageSize[0];
        $height = $imageSize[1];
        exit;
        $filePath = ROOT_PATH."public/1.xls";
//        echo ROOT_PATH;
        $reader = new Xls();
//        echo $filePath;exit;
//        print_r($reader);exit;
        if (!$PHPExcel = $reader->load($filePath)) {
            $this->error(__('Unknown data format'));
        }
        $currentSheet = $PHPExcel->getSheet(1);  //读取文件中的第一个工作表
        var_dump($currentSheet);

        exit;

        cookie("111111lishiketang.com",'values');

        exit;

        $result = BaiduTransapi::translate("我是中国人",'zh','en');
        var_dump($result);
    }


}
